package com.fs.controller;

import com.fs.entity.Attractions;
import com.fs.service.AttractionsService;
import com.fs.util.ResponseData;
import com.fs.util.ResponseDataUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 景点信息 */
@RestController
public class AttractionsController
{
    @Autowired
    private AttractionsService attractionsService;
    /**
    *  前台列表页
    */
    @RequestMapping("/index")
    public ResponseData index()
    {
        List<Attractions> hotAttractions = attractionsService.getHotAttractions();
        return ResponseDataUtil.buildOk(hotAttractions);
    }

    @RequestMapping("/list")
    public ResponseData list()
    {
        List<Attractions> list = attractionsService.getList();
        return ResponseDataUtil.buildOk(list);
    }

}
